package com.getword.socket;

public class Test2 {
    public static void main(String[] args) {
        String filename = "fdsatxt";
        int dotIndex = filename.lastIndexOf(".");
        if (dotIndex < 0 || dotIndex == filename.length() - 1) {

        }
        else {
            System.out.println(filename.substring(dotIndex + 1));
        }

    }
}
